﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;


namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public static bool arabic = false;
        public Form1()
        {
            InitializeComponent();
        }
       
        private void button3_Click(object sender, EventArgs e)
        {
            
            if (!arabic)
            {
                ChangeLanguage("ar-OM");
                arabic = true;
            }
            else
            {
                ChangeLanguage("en");
                arabic = false;
            }
        }
          private void ChangeLanguage(string lang)
{
  foreach (Control c in this.Controls)
  {
    ComponentResourceManager resources = 
          new ComponentResourceManager(typeof(Form1));
    resources.ApplyResources(c,c.Name,new CultureInfo(lang));
  }
}



        
        private void btOpenNewForm_Click(object sender, EventArgs e)
        {
            Form2 F2 = new Form2();
            F2.Show();
        }

        private void btChangeIcon_Click(object sender, EventArgs e)
        {
            Icon = Properties.Resources.Icon1;
        }

        private void btResetIcon_Click(object sender, EventArgs e)
        {
            Icon = default(Icon);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Icon = default(Icon);
        }

        private void btCallClass1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }
    }
}
